<?php 

class DBConnection {
	private $m_sqli = NULL;
	
	public function Connect (){
		$password = "";
		
		$this->m_sqli = new mysqli(
		SETTINGS::DBHOST,
		SETTINGS::DBUSER,
		SETTINGS::DBPASSWORD, 
		SETTINGS::DATABASE
		);
		$this->m_sqli->set_charset("utf8");
		
	}
	
	public function Close(){
		
		$this->m_sqli->close();
	}
	
	public function Prepare ($sql) {
		$stmt = $this->m_sqli->prepare($sql);
		if ($stmt === FALSE){
			echo "Prepare av '$sql' misslyckades" . $this->m_sqli->error;
			return false;
		}
		return $stmt;
	}
}